<?php
namespace app\apisell\controller\admin;

use app\apisell\model\refund\RefundModel;
use app\apisell\service\order\OrderService;
use app\apisell\service\refund\RefundService;
use app\common\controller\BaseController;
use app\common\utils\Res;
use think\facade\Db;

/**
 * 退款管理
 */
class Refund extends BaseController
{
    public function index()
    {
        $param = $this->request->post();
        $param['popu_id'] =  $this->request->popuId;//获取操作id
        $param['ispopu_id'] =  $this->request->isPopu;//0 是平台

        $result = RefundService::list($param);
        
        return $result;
    }
    public function list()
    {
        $param = $this->request->post();
        $param['popu_id'] =  $this->request->popuId;//获取操作id
        $param['ispopu_id'] =  $this->request->isPopu;//0 是平台

        $result = RefundService::relist($param);

        return $result;
    }
    /**
     * 执行同意验证操作
     *
     * 该方法主要用于处理退款同意验证的逻辑，它接收前端传递的参数，
     * 并调用RefundModel中的agreeVerify方法进行同意验证，然后返回验证结果
     */
    public function agreeVerify()
    {
        // 接收前端POST请求参数
        $param = $this->request->post();
        $param['uid'] =  $this->request->uid;//获取操作id

        // 调用RefundModel的agreeVerify方法进行同意验证，并返回验证结果
        $result = RefundModel::agreeVerify($param);
        
        // 返回验证结果
        return $result;
    }
    //拒绝退款
    public function refuseVerify()
    {
        // 接收前端POST请求参数
        $param = $this->request->post();
        $param['uid'] =  $this->request->uid;//获取操作id

        // 调用RefundModel的refuseVerify方法进行拒绝验证，并返回验证结果
        $result = RefundModel::refuseVerify($param);
        
        // 返回验证结果
        return $result;
    }
    public function agreeVerifyGroups()
    {
        // 接收前端POST请求参数
        $param = $this->request->post();
        $param['uid'] =  $this->request->uid;//获取操作id

        // 调用RefundModel的agreeVerify方法进行同意验证，并返回验证结果
        $result = RefundModel::agreeVerifyGroupsRefund($param);

        // 返回验证结果
        return $result;
    }
    //拒绝退款
    public function refuseVerifyGroups()
    {
        // 接收前端POST请求参数
        $param = $this->request->post();
        $param['uid'] =  $this->request->uid;//获取操作id

        // 调用RefundModel的refuseVerify方法进行拒绝验证，并返回验证结果
        $result = RefundModel::refuseVerifyGroupsRefund($param);

        // 返回验证结果
        return $result;
    }


}
